package crivia.ecp.carry.eb;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.PageContext;

import crivia.ecp.carry.tableString.TableString;
import crivia.ecp.exception.WrongDocumentObject;
import weaver.common.util.taglib.SplitPageTag;

public class TableStringExecuter {
	
	public TableStringExecuter(PageContext page) {
		executer = new SplitPageTag();
		executer.setPageContext(page);
	}

	private SplitPageTag executer;
	public void execute(TableString tableString){
		executer.setTableString(tableString.toString());
		executer.setIsShowTopInfo(tableString.hasTop() + "");
		executer.setIsShowBottomInfo(tableString.hasBottom() + "");
		executer.setMode(tableString.getMode());
		executer.setShowExpExcel(tableString.hasExpExcel() + "");
		try {
			executer.doStartTag();
			executer.doEndTag();
		} catch (JspException e) {
			throw new WrongDocumentObject(e);
		}
	}
	
}
